package hua.mtreader.base;

import java.lang.ref.WeakReference;

import hua.mtreader.feature.bookshelf.view.IBookshelfView;

/**
 * Created by Administrator on 2017/3/23.
 */

public class BaseFragmentPresenter<T> {

    public WeakReference<T> mViewRef;

    public void attachView(T view) {
        this.mViewRef = new WeakReference<T>(view);
    }

    public void detachView() {
        if (mViewRef != null) {
            mViewRef.clear();
        }
    }

    public T getView(){
        return mViewRef.get();
    }

}
